//
//  Touch.h
//  Prism
//
//  Created by Bas du Pre on 25-05-11.
//  Copyright 2011 UU. All rights reserved.
//

#pragma once

namespace Prism {
namespace Graphics {
    class Touch;
    class TouchEventArgs;
    class Scene;
    class Node;
}
}

#include "../global.h"
#include "../Events.h"

namespace Prism {
namespace Graphics {
    
    class Touch : public PObject {
    public:
        Touch();
        Touch(PointF location, PointF previousLocation);
        virtual ~Touch();
        
        PInt tapCount;
        PFloat timestamp;
        enum Phase {
            TouchPhaseBegan,
            TouchPhaseMoved,
            TouchPhaseStationary,
            TouchPhaseEnded
        } phase;
        
        PointF locationOnScreen();
        PointF previousLocationOnScreen();
        PointF locationInNode();
        List<Node*> touchedNodes;
        Scene* scene;
        
        ///\todo location in node
        
        bool touchesNode(Node *node);
        
    private:
        PointF location;
        PointF previousLocation;
        
    };
    
    class TouchEventArgs : public EventArgs {
    public:
        TouchEventArgs();
        
        Touch *touch;
        bool stop;
    };
    
    class TouchesEventArgs : public EventArgs {
    public:
        TouchesEventArgs();
        
        List<Touch *> touches;
        bool stop;
    };
}
}

#include "Node.h"
